package com.zuilapsa.jmc.model;

import org.dom4j.*;

public class DefinitionWrapper implements HelpInterface{
	public Element definition;
	
	public DefinitionWrapper(Element definition) {
		this.definition = definition; 
	}
	
	public boolean isProperty() {
		return definition.getName().equalsIgnoreCase("property");
	}
	
	public boolean isLevel() {
		return definition.getName().equalsIgnoreCase("level");
	}
	
	public boolean isAction() {
		return definition.getName().equalsIgnoreCase("action");
	}
	
	public boolean isGlob() {
		return definition.attributeValue("name").contains("{*}");
	}
	public String getTypeName() {
		return definition.getName();
	}
	
	public String getName() {
		return definition.attributeValue("name");
	}
	public String getHelpString() {
		return definition.attributeValue("help","No help available for this "+getTypeName());
	}
}
